<template>
	<view>
		<view>
			<u-tabs-swiper ref="uTabs" font-size='26' :list="tabList" :current="current" @change="tabsChange"
				:is-scroll="false" active-color='#FE5734' inactive-color='#666666' swiperWidth="750"></u-tabs-swiper>
		</view>
		<view class="" style="height: 800px;">
			<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
				<swiper-item>
					<view class="aj-center">
						<image src="../../static/empty.png" mode="" style="width: 231px;height: 247px; "></image>
					</view>
					<!-- <scroll-view lower-threshold='200' refresher-enabled scroll-y  style="height:800px;width: 100%;"
						:refresher-triggered='refresher_triggered' @refresherrefresh='refresherrefresh'
						@refresherrestore='refresherrestore' @scrolltolower="onreachBottom">
						
					</scroll-view> -->
				</swiper-item>
				<swiper-item>
					<view class="aj-center">
						<image src="../../static/empty.png" mode="" style="width: 231px;height: 247px; "></image>
					</view>
					<!-- <scroll-view lower-threshold='200' refresher-enabled scroll-y style="height: 800rpx;width: 100%;"
						:refresher-triggered='refresher_triggered' @refresherrefresh='refresherrefresh'
						@refresherrestore='refresherrestore' @scrolltolower="onreachBottom">

						<view class="aj-center">
							暂无数据
						</view>
					</scroll-view> -->
				</swiper-item>
				<swiper-item>
					<view class="aj-center">
						<image src="../../static/empty.png" mode="" style="width: 231px;height: 247px; "></image>
					</view>
					<!-- <scroll-view lower-threshold='200' refresher-enabled scroll-y style="height: 800rpx;width: 100%;"
						:refresher-triggered='refresher_triggered' @refresherrefresh='refresherrefresh'
						@refresherrestore='refresherrestore' @scrolltolower="onreachBottom">

						<view class="aj-center">
							暂无数据
						</view>
					</scroll-view> -->
				</swiper-item>
			</swiper>
		</view>
		<u-tabbar :list="list" :iconSize=40 :mid-button="true" :before-switch="beforeSwitch"></u-tabbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				refresher_triggered: false, // 刷新态true 表示下拉刷新已经被触发
				refresher: false, // 当下拉刷新执行中时禁止再次下拉
				current: 0,
				swiperCurrent: 0,
				list: [],
				tabsListshoop: [{
					id: 1,
					// img: '../../static/shoop/mainpicture2@2x.png',
					img: 'https://oss.xhm2006.com/Public/WechatApplet/erji.png',
					title: '声丽（SENICC）ST-2688PRO 头戴式电脑耳机 ',
					place: '【郑州】金水区文化路',
					price: '¥299.99',
					collection: '4396人收藏'
				}, {
					id: 1,
					// img: '../../static/shoop/mainpicture2@2x.png',
					img: 'https://oss.xhm2006.com/Public/WechatApplet/erji.png',
					title: '声丽（SENICC）ST-2688PRO 头戴式电脑耳机 ',
					place: '【郑州】金水区文化路',
					price: '¥299.99',
					collection: '4396人收藏'
				}, {
					id: 1,
					// img: '../../static/shoop/mainpicture2@2x.png',
					img: 'https://oss.xhm2006.com/Public/WechatApplet/erji.png',
					title: '声丽（SENICC）ST-2688PRO 头戴式电脑耳机 ',
					place: '【郑州】金水区文化路',
					price: '¥299.99',
					collection: '4396人收藏'
				}],
				tabList: [{
						id: 1,
						name: '推荐'
					},
					{
						id: 2,
						name: '二手水瓶'
					},
					{
						id: 3,
						name: '运动装备'
					}
				],
			}
		},
		onLoad() {
			this.list = this.$store.state.list
		},
		methods: {
			//跳转详情页
			shoopItem() {},
			// 下拉刷新
			refresherrefresh() {
				this.refresher_triggered = true;
				setTimeout(() => {
					this.refresher_triggered = false;
				}, 2000)
			},
			// 自定义下拉刷新被复位
			refresherrestore() {

			},
			// scroll-view到底部加载更多
			onreachBottom() {

			},
			change(index) {
				this.current = index
			},
			beforeSwitch(index) {
				console.log(index);
				return true
			},
			animationfinish(e) {
				let current = e.detail.current;
				// this.$refs.uTabs.setFinishCurrent(current);
				this.swiperCurrent = current;
				this.current = current;
			},
			transition(e) {
				// let dx = e.detail.dx;
				// this.$refs.uTabs.setDx(dx);
			},
			tabsChange(index) {
				this.swiperCurrent = index;
			},

		}
	}
</script>

<style>
	.image_first {
		width: 326rpx;
		height: 326rpx;
		margin-bottom: 20rpx;


	}
</style>
